{#
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
 # http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#}
{% extends "manage/manage_base.html" %}
{% set project_name = project.name %}
{% block title %}
  {% if form.errors %}
    {% trans %}Error processing form{% endtrans %} –
  {% endif %}
  {% trans %}Submit Malware Report for Project{% endtrans %}
{% endblock title %}
{% block content %}
  <div class="horizontal-section">
    <div class="site-container">
      <h1 class="page-title">{% trans %}Submit Malware Report for Project:{% endtrans %} {{ project_name }}</h1>
      <p>
        {% trans %}
        Use this form to submit reports of malicious projects for review by the PyPI Administrators.
        Examples of malicious activity in projects include typo-squatting, dependency confusion, data exfiltration,
        obfuscation, command/control, and other similar behaviors.{% endtrans %}
      </p>
      <p>
        {% trans href="https://inspector.pypi.io/" %}
        You'll be required to provide a link to notable source code using our <a href="{{ href }}">Inspector</a> service.
        This allows for reports to be reviewed more quickly, so please ensure that the link is to
        a meaningful portion of the relevant files.{% endtrans %}
      </p>
      <p>
        {% trans %}
        Your summary should include a general description of the malicious behavior
        as well as any other pertinent details such as what specific release(s) or file(s)
        are involved if it is not an entirely malicious Project.{% endtrans %}
      </p>
      <form class="radio-toggle-form"
            method="post"
            action="{{ request.current_route_path() }}">
        <input name="csrf_token"
               type="hidden"
               value="{{ request.session.get_csrf_token() }}">
        {{ form_errors(form) }}
        <div class="form-group">
          <label for="inspector_link" class="form-group__label">
            Inspector Link
            <span class="form-group__required">{% trans %}(required){% endtrans %}</span>
          </label>
          {{ form.inspector_link(class="form-group__field") }}
          <p class="form-group__help-text">
            {% trans %}Fill with a link to the problematic code lines from{% endtrans %}
            <a href="https://inspector.pypi.io/project/{{ project_name }}/"
               target="_blank">Inspector</a>.
          </p>
          <div id="inspector_link-errors">{{ field_errors(form.inspector_link) }}</div>
        </div>
        <div class="form-group">
          <label for="summary" class="form-group__label">
            {% trans %}Summary{% endtrans %}
            <span class="form-group__required">{% trans %}(required){% endtrans %}</span>
          </label>
          {{ form.summary(class="form-group__field", rows=10) }}
          <p class="form-group__help-text">A brief description of the problem.</p>
          <div id="summary-errors">{{ field_errors(form.summary) }}</div>
        </div>
        {{ form.submit(class="button button--danger", value="Submit Malware Report") }}
      </form>
    </div>
  </div>
{% endblock content %}
